package com.hua.api.modules.home.dao;

import com.hua.api.core.framework.statement.EntityManagerTemplate;
import com.hua.api.core.framework.statement.Statement;
import com.hua.api.core.framework.statement.mysql.StatementFactoryImpl;
import com.hua.api.modules.home.domain.MemberSubscribeTemplate;
import org.springframework.stereotype.Repository;

@Repository("memberInfoDao")
public class MemberInfoDao extends EntityManagerTemplate {

    public MemberSubscribeTemplate findMemberSubscribeTemplate(Integer userId,String templateId){
        Statement statement = StatementFactoryImpl.getInstance().createStatement(" from MemberSubscribeTemplate m where m.userId=?1 and m.templateId=?2 ");
                  statement.addParams(userId,templateId);
        return findObject(statement,MemberSubscribeTemplate.class);
    }

}
